package GUILayer;

import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;

import java.awt.BorderLayout;

import javax.swing.JButton;

import java.awt.FlowLayout;
import java.awt.CardLayout;

import javax.swing.border.LineBorder;

import java.awt.Color;

import javax.swing.JLabel;
import javax.swing.SwingConstants;

import java.awt.Font;

import javax.swing.border.EtchedBorder;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GUIfoods extends JFrame {

	private static final long serialVersionUID = 1L;
	
	JLayeredPane orderLayer;


	public static void main(String[] args) {
		try {
			new GUIfoods();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public GUIfoods() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true);
		setBounds(1, 1, 940, 650);
		
		JPanel topButtonPanel = new JPanel();
		topButtonPanel.setBorder(new LineBorder(new Color(0, 0, 0)));
		getContentPane().add(topButtonPanel, BorderLayout.NORTH);
		
		JButton btnOrder = new JButton("Order");
		
		JButton btnProduct = new JButton("Product");
		
		JButton btnMissingOrders = new JButton("Missing Orders");
		topButtonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		topButtonPanel.add(btnOrder);
		topButtonPanel.add(btnProduct);
		topButtonPanel.add(btnMissingOrders);
		
		JPanel cardPanel = new JPanel();
		getContentPane().add(cardPanel, BorderLayout.CENTER);
		cardPanel.setLayout(new CardLayout(0, 0));
		
		JPanel panelOrder = new JPanel();
		cardPanel.add(panelOrder, "name_2681526515745");
		panelOrder.setLayout(null);
		
		final JPanel panelOrderCard = new JPanel();
		panelOrderCard.setBounds(152, 0, 772, 577);
		panelOrder.add(panelOrderCard);
		panelOrderCard.setLayout(new CardLayout(0, 0));
		
		JButton btnUnopened = new JButton("Unopened");
		btnUnopened.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				CardLayout card = (CardLayout) panelOrderCard.getLayout();
				card.show(panelOrderCard, "name_6301579558431");
			}
		});
		btnUnopened.setBounds(10, 52, 132, 23);
		panelOrder.add(btnUnopened);
		
		JButton btnOpened = new JButton("Opened");
		btnOpened.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				CardLayout card = (CardLayout) panelOrderCard.getLayout();
				card.show(panelOrderCard, "name_6816443382539");
			}
		});
		btnOpened.setBounds(10, 86, 132, 23);
		panelOrder.add(btnOpened);
		
		JButton btnFinished = new JButton("Finished");
		btnFinished.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				CardLayout card = (CardLayout) panelOrderCard.getLayout();
				card.show(panelOrderCard, "name_7524509858035");
			}
		});
		btnFinished.setBounds(10, 120, 132, 23);
		panelOrder.add(btnFinished);
		
		JPanel panelOrderUnopened = new JPanel();
		panelOrderUnopened.setBorder(new LineBorder(new Color(0, 0, 0)));
		panelOrderCard.add(panelOrderUnopened, "name_6301579558431");
		panelOrderUnopened.setLayout(null);
		
		JLabel lblOrderUnopen = new JLabel("Unopened Orders");
		lblOrderUnopen.setBounds(10, 11, 167, 25);
		panelOrderUnopened.add(lblOrderUnopen);
		lblOrderUnopen.setFont(new Font("Tahoma", Font.PLAIN, 16));
		
		JPanel panelOrderUnopenedInner = new JPanel();
		panelOrderUnopenedInner.setBounds(10, 47, 752, 519);
		panelOrderUnopened.add(panelOrderUnopenedInner);
		panelOrderUnopenedInner.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
		
		JPanel panelOrderOpened = new JPanel();
		panelOrderOpened.setBorder(new LineBorder(new Color(0, 0, 0)));
		panelOrderCard.add(panelOrderOpened, "name_6816443382539");
		panelOrderOpened.setLayout(null);
		
		JPanel panelOrderOpenedInner = new JPanel();
		panelOrderOpenedInner.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
		panelOrderOpenedInner.setBounds(10, 47, 752, 519);
		panelOrderOpened.add(panelOrderOpenedInner);
		
		JLabel lblOpened = new JLabel("Opened Orders");
		lblOpened.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblOpened.setBounds(10, 11, 160, 25);
		panelOrderOpened.add(lblOpened);
		
		JPanel panelOrderFinished = new JPanel();
		panelOrderFinished.setBorder(new LineBorder(new Color(0, 0, 0)));
		panelOrderCard.add(panelOrderFinished, "name_7524509858035");
		panelOrderFinished.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
		panel.setBounds(10, 47, 752, 519);
		panelOrderFinished.add(panel);
		
		JLabel lblFinishedOrders = new JLabel("Finished Orders");
		lblFinishedOrders.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblFinishedOrders.setBounds(10, 11, 139, 25);
		panelOrderFinished.add(lblFinishedOrders);
		
	}
}
